// pages/buysucc/buysucc.js
var that,
  api = new (require('../../utils/api.js')),
  headimg = api.getimgurl(),
  app = getApp(),
  util = new (require('../../utils/util.js'));
Page({

  /**
   * 页面的初始数据
   */
  data: {
    orderId: '',
    washmycarddata: '',
    showmod: !10.
    
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    that = this;
    that.setData({ orderId: options.orderId,Super:options.super||0 }, () => {
      that.getdata()
    })
  },
  getdata() {
    let { orderId,Super} = that.data
    if(Super==1){
      api.vipwashdetail(orderId, res => {
        if (res.data.code == 0) {
          if (res.data.entity) {
            let washmycarddata = res.data.entity.data
            washmycarddata.payTime = util.toDate1(washmycarddata.payTime)
            washmycarddata.validTime = util.toDate1(washmycarddata.validTime)
            that.setData({
              washmycarddata
            })
          }
        }
      })
    }else{
      api.washdetail(orderId, res => {
        if (res.data.code == 0) {
          if (res.data.entity) {
            let washmycarddata = res.data.entity.data
            washmycarddata.payTime = util.toDate1(washmycarddata.payTime)
            washmycarddata.validTime = util.toDate1(washmycarddata.validTime)
            that.setData({
              washmycarddata
            })
          }
        }
      })
    }

   
    let posId = 803
    api.bulkpopon(posId, res => {
      if (res.data.code == 0) {
        if (res.data.entity.data) {
          that.setData({ bulkpopondata: res.data.entity.data, showmod: !0 })
        }
      }
    })
    let { corpBulkTag } = app.logininfo
    that.setData({ corpBulkTag })
  },
  to(e) {
    let { url, brief } = e.currentTarget.dataset
    wx.navigateTo({
      url: `../${url}/${url}?brief=${brief}`,
    })
  },
  togoodsdetail(e) {
    let { id } = e.currentTarget.dataset
    wx.navigateTo({
      url: '../shopdetail/shopdetail?id=' + id,
    })
  },
  hidemod() {
    that.setData({ showmod: !1 })
  },
  toback() {
    wx.navigateBack()
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})